<?php

namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class Topics extends Model
{
    use SoftDelete;
    //
    protected $autoWriteTimestamp=true;

    protected $deleteTime='delete_time';

    //多对多 专题 => 文章
    public function posts()
    {
        return $this->belongsToMany('bg_posts','post_topic_access','post_id','topic_id');
    }

    //关联 中甲表 ,用于专题文章统计 => 要是关联表有状态信息,则取中间表为统计依据不可行
    /*public function postTopics()
    {
        return $this->hasMany('post_topic_access','topic_id','id');
    }*/
}
